package club.sh.generator.enums;

import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine;
import com.baomidou.mybatisplus.generator.engine.BeetlTemplateEngine;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import com.baomidou.mybatisplus.generator.engine.VelocityTemplateEngine;
import lombok.Getter;

/**
 * 代码生成模板引擎枚举
 * @author 林思浩
 * @date 2020/07/24 10:09
 */
@Getter
public enum TemplateEnum {

    BEETL_TEMPLATE_ENGINE("/templates/mapper.xml.btl", new BeetlTemplateEngine()),
    VELOCITY_TEMPLATE_ENGINE("/templates/mapper.xml.", new VelocityTemplateEngine()),
    FREEMARKER_TEMPLATE_ENGINE("/templates/mapper.xml.ftl", new FreemarkerTemplateEngine());

    private String templateMapperXmlFile;
    private AbstractTemplateEngine templateEngine;

    TemplateEnum(String templateMapperXmlFile, AbstractTemplateEngine templateEngine) {
        this.templateMapperXmlFile = templateMapperXmlFile;
        this.templateEngine = templateEngine;
    }

}
